import store from '../store'
import request from '../utils/request'
const getUserSelectionInformation = () => {
  return request({
    url: '/v1_0/user/channels'
    // headers: {
    //   Authorization: `Bearer ` + `${store.state.token}`
    // }
  })
}
const getSearchInformation = (val) => {
  return request({
    url: '/v1_0/suggestion',
    params: {
      q: val
    }
  })
}
const getDareNotInterested = (id) => {
  return request({
    method: 'POST',
    url: '/v1_0/article/dislikes',
    // headers: {
    //   Authorization: `Bearer ` + `${store.state.token}`
    // },
    data: {
      target: id
    }
  })
}

const getUsersReport = (obj) => {
  return request({
    method: 'POST',
    url: '/v1_0/article/reports',
    // headers: {
    //   Authorization: `Bearer ` + `${store.state.token}`
    // },
    data: {
      target: toString(obj.id),
      type: toString(obj.type),
      remark: obj.remark || '0'
    }
  })
}

export {
  // 用户已选
  getUserSelectionInformation,
  // 获取搜索信息
  getSearchInformation,
  // 不敢兴趣
  getDareNotInterested,
  // 举报
  getUsersReport
}
